package com.zh.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zh.common.DeleteRequest;
import com.zh.domain.dto.user.UserAddRequest;
import com.zh.domain.dto.user.UserQueryRequest;
import com.zh.domain.dto.user.UserUpdateRequest;
import com.zh.domain.vo.user.UserVO;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zh.domain.entity.User;

/**
 * 用户服务
 *
 */
public interface UserService extends IService<User> {

    /**
     * 用户注册
     *
     * @param username   用户账户
     * @param password  用户密码
     * @param rePassword 校验密码
     * @param name      姓名可选
     * @return 新用户 id
     */
    long userRegister(String username, String password, String rePassword,String nickname,String name);

    /**
     * 用户登录
     *
     * @param userAccount  用户账户
     * @param userPassword 用户密码
     * @param request
     * @return 脱敏后的用户信息
     */
    UserVO userLogin(String userAccount, String userPassword, HttpServletRequest request, HttpServletResponse response);

    /**
     * 获取查询条件
     *
     * @param userQueryRequest
     * @return
     */
    LambdaQueryWrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);

    /**
     * 创建用户
     * @param userAddRequest
     * @param response
     * @return
     */
    Integer add(UserAddRequest userAddRequest, HttpServletResponse response);

    /**
     * 删除用户
     * @param deleteRequest
     * @param response
     * @return
     */
    boolean removeUserById(DeleteRequest deleteRequest, HttpServletResponse response);

    /**
     * 更新用户
     * @param userUpdateRequest
     * @return
     */
    boolean updateUser(UserUpdateRequest userUpdateRequest);

    UserVO getUserVoById(Integer id);

    List<UserVO> listUserVoByIds(List<Integer> ids);
}
